<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>do...while验证用户名和密码</title>
</head>

<body>
    <script>
        do {

            var userName = prompt("请输入用户名");
            var passWord = prompt("请输入密码");

        } while (userName != "jty" || passWord != "123456")
        alert("登录成功!");
    </script>
</body>

</html>